// 登录切换效果

// 账号登录
let Paging_Login = document.querySelector('.Paging_Login');
// 扫码登录
let Scan_code = document.querySelector('.Scan_code');

// console.log(Paging_Login);
// 点击账号登录
let Switch_Login = document.querySelector('.Switch_Login');
// 点击扫码登录
let Switch_Scan_code = document.querySelector('.Switch_Scan_code');

Switch_Login.addEventListener('click',function(){
    Paging_Login.style.display='block';
    Scan_code.style.display='none';
})

Switch_Scan_code.addEventListener('click',function(){
    Scan_code.style.display='block';
    Paging_Login.style.display='none';
})


// 登录

from.addEventListener("submit", function (event) {
    let Benchmark = true;
    //用户
    if (user.value.length > 2 && user.value.length <= 18) {
        text_span.innerHTML = "通过";
        text_span.style.color = "green";

    } else {
        text_span.innerHTML = "输入错误";
        text_span.style.color = "red";
        Benchmark = false;
    }

    //密码 
    if (Pasworder.value.length > 2 && Pasworder.value.length <= 18) {
        pswoder_span.innerHTML = "通过";
        pswoder_span.style.color = "green";

    } else {
        pswoder_span.innerHTML = "输入错误";
        pswoder_span.style.color = "red";
        Benchmark = false;
    }

    if (Benchmark == false) {
        event.preventDefault(); 
    }
})